package com.mflex.mwms.model.enumeration;

import com.xuexiang.xutil.common.StringUtils;

/**
 * 
 */
public enum StockType {
    DYNAMIC("0", "动碰盘点"),
    ITEMNUMMER("1", "料号盘点"),
    LOCATION("2", "库位盘点"),
    PKG("3", "包盘点");

    private String code;
    private String valueStr;

    private StockType(String code, String valueStr) {
        this.code = code;
        this.valueStr = valueStr;
    }

    public String getCode() {
        return code;
    }
    public String getValueStr(){
        return valueStr;
    }

    public static StockType match(String key){
        StockType result = null;
        for(StockType s : values()){
            if(StringUtils.equals(s.getCode(),key)){
                result= s;
                break;
            }
        }
        return result;
    }
}
